package com.ych.modules.api.authorInfc.jackpot.service;

import com.ych.modules.base.dbEntity.TRaffleTicketJackpotEntity;
import com.ych.modules.base.dbEntity.TUserRaffleTicketEntity;

import java.math.BigDecimal;

/**
 * Created with IntelliJ IDEA.
 * Author: Usopp.tsui
 * Date: 2021/3/15
 * Time: 16:59
 * Description:
 */
public interface JackpotService {
    void addJackpot(TRaffleTicketJackpotEntity entity);

    /**
     * 奖池金额累加，用作奖池金额累计
     *
     * @param jackpotId
     * @param amount
     */
    void amountIncrease(String jackpotId, BigDecimal amount);

    void applyJackpot(TUserRaffleTicketEntity ticketEntity);

    TRaffleTicketJackpotEntity getJackpot(String jackpotId);

    TRaffleTicketJackpotEntity getCurrentJackpot();

    /**
     * 奖池金额累计增加，用于各个业务上面需要分配金额到奖池的地方
     *
     * @param chargeBusinessType 业务类型
     * @param amount             增加的金额
     * @param businessId         业务id
     * @param jackpotId 奖池id，不传默认为当前正在进行的奖池
     */
    void addAmountToJackpot(String chargeBusinessType, BigDecimal amount, String businessId, String jackpotId);

    void runLottery(String jackpotId);
}
